package org.merak.core.test.model;

import java.util.Arrays;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Vector;

import org.merak.core.model.Identified;

public class Entity extends Identified<Integer> {

	//~ Attributes ///////////////////////////////////////////////////////////////
	//****************************************************************************
	private String        string         = null;
	private String        escapedString  = null;
	private int           integer        = 0;
	private double        floating       = 0;
	private Date          date           = null;
	private KingdomOfLife enume          = null;
	private char          character      = 0;
	private boolean       bool           = false;

	private String[]            array       = null;
	private Iterable<String>    iterable    = null;
	private Map<String,Object>  map         = null;
	private Enumeration<String> enumeration = null;

	//~ Constructors /////////////////////////////////////////////////////////////
	//****************************************************************************
	public Entity(Integer id) {
		super(id);
		this.preapreToBeTested();
	}

	//~ Methods //////////////////////////////////////////////////////////////////
	//****************************************************************************
	private void preapreToBeTested() {

		// Raw types
		this.string        = " john     ";
		this.escapedString = "\"john\"'\n\r\t\b\u001F";
		this.integer       = 9;
		this.floating      = 0.7;
		this.date          = null;
		this.enume         = KingdomOfLife.PROTISTA;
		this.character     = 'J';
		this.bool          = false;
		this.date          = new Date(404280000000l); // "24/10/1982"

    	// group types
    	this.array    = new String[]{"foo","bar","ozz"};
    	this.iterable = Arrays.asList(this.array);

		// group types: enumeration
    	Vector<String> vector = new Vector<String>();
    	vector.add("FOO");
    	vector.add("BAR");
    	vector.add("OZZ");
    	this.setEnumeration(vector.elements());

        // group types: map
    	Map<String,Object> map = new HashMap<String,Object>();
    	map.put("string" , " john     ");
    	map.put("integer", 31);
    	this.setMap(map);

	}
	//****************************************************************************
	public Object getNull() {
		return null;
	}

	public String getString() {
		return this.string;
	}

	public void setString(String string) {
		this.string = string;
	}

	public String getEscapedString() {
		return this.escapedString;
	}

	public void setEscapedString(String escapedString) {
		this.escapedString = escapedString;
	}

	public int getInteger() {
		return this.integer;
	}

	public void setInteger(int integer) {
		this.integer = integer;
	}

	public double getFloating() {
		return this.floating;
	}

	public void setFloating(double floating) {
		this.floating = floating;
	}

	public Date getDate() {
		return this.date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public KingdomOfLife getEnum() {
		return this.enume;
	}

	public void setEnum(KingdomOfLife enumeration) {
		this.enume = enumeration;
	}

	public String[] getArray() {
		return this.array;
	}

	public void setArray(String[] array) {
		this.array = array;
	}

	public char getCharacter() {
		return this.character;
	}

	public void setCharacter(char character) {
		this.character = character;
	}

	public boolean isBool() {
		return this.bool;
	}

	public void setBool(boolean bool) {
		this.bool = bool;
	}

	public Iterable<String> getIterable() {
		return this.iterable;
	}

	public void setIterable(Iterable<String> iterable) {
		this.iterable = iterable;
	}

	public Map<String, Object> getMap() {
		return this.map;
	}

	public void setMap(Map<String, Object> map) {
		this.map = map;
	}

	public Enumeration<String> getEnumeration() {
		return this.enumeration;
	}

	public void setEnumeration(Enumeration<String> enumeration) {
		this.enumeration = enumeration;
	}
	//****************************************************************************

}
